-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: regression of issue: ShadowHost can't be a string (issue 941) #1092
Conversation
The problem here is that ShadowRoot and HTMLAnchorElement have colliding |
I think the problem in the left side is this line Here is the process how the error happens: |
@Mark-Fenng I am a bit lost here, we do check if the |
https://github.com/rrweb-io/rrweb/pull/1092/files#diff-048da15f20b717b1ea5aa5346398dfed2fe4e24a7d38445b94cbe707640c9fc5L523 |
Ah, I understand it better now. Thanks. Can we merge this PR then? |
We need at least one reviewer to approve this before merging it. |
Bug
This PR is to fix a bug which is a regression of #941. The original one has been fixed but imported again in #1049
Reason
Given the text node of a detached HTMLAnchorElement, getRootNode() will return the anchor element itself and its host property is a string.
Fix
The fix is like #1020. I added unit tests to cover all key codes and I hope this bug won't show up anymore.